package com.simpleframe.core.io;

import java.io.File;
import java.io.IOException;
import java.io.InputStream;
import java.net.URI;
import java.net.URL;

public interface Resource {
	/**
	 * 判断资源是否存在
	 */
	boolean exists();

	/**
	 * 判断资源是否可读
	 */
	boolean isReadable();

	/**
	 *判断资源已经打开
	 */
	boolean isOpen();
	
	/**
	 * 
	 * @return
	 * @throws IOException
	 */
	URL getURL() throws IOException ;
	
	/**
	 * 
	 * @return
	 * @throws IOException
	 */
	File getFile() throws IOException;
	
	/**
	 * 
	 * @return
	 * @throws IOException
	 */
	InputStream getInputStream() throws IOException;

	/**
	 * 
	 * @return
	 * @throws IOException
	 */
	long lastModified() throws IOException;

	/**
	 * 获得文件名称
	 */
	String getFilename();

}
